package xio.ccf_201512;

import java.util.Scanner;

/**
 * 201512-1 数位之和 100
 * Created by ywb47 on 2017/10/3.
 */
public class NumSum {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String num = sc.next();
        int sum = 0;
        for (char c : num.toCharArray()) {
            sum = sum + Integer.parseInt(String.valueOf(c));
        }
        System.out.println(sum);
    }
}
